-
Notifications
You must be signed in to change notification settings - Fork 452
pkg: Force breaks between depext hint and depext list #12312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| File "dune-project", line 1, characters 0-0: | ||
| Error: Invalid first line, expected: (lang <lang> <version>) | ||
|
|
||
| Hint: You may want to verify the following depexts are installed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be updated too with the new line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally yes but I haven't figured out how to express this with Pp. The algorithm that Pp uses for formatting breaks lines in such a way that it breaks between Hint: and the message depending on the length of the message. In this case it splits if the concatenation of all depext names is longer than some threshold even though the depext names are in a vbox so their total width shouldn't matter (only their maximum width).
It might be a bug in Pp though I don't completely understand Pp.
| File "dune-project", line 1, characters 0-0: | ||
| Error: Invalid first line, expected: (lang <lang> <version>) | ||
|
|
||
| Hint: You may want to verify the following depexts are installed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be updated too with the new line?
782f417 to
c0041b6
Compare
| [ Pp.textf "You may want to verify the following depexts are installed:" | ||
| ; Pp.enumerate ~f:Pp.verbatim depexts | ||
| ] | ||
| |> Pp.concat_map ~sep:Pp.cut ~f:(fun pp -> Pp.box pp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ~f:Fun.id and you should put Pp.hovbox on the first line and Pp.vbox on the second. Then you should do a Pp.vbox after concatenating. I think this will give you what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you mean:
let depexts_hint = function
| [] -> None
| depexts ->
[ Pp.hovbox @@ Pp.textf "You may want to verify the following depexts are installed:"
; Pp.vbox @@ Pp.enumerate ~f:Pp.verbatim depexts
]
|> Pp.concat_map ~sep:Pp.cut ~f:Fun.id
|> Pp.vbox
|> Option.some
;;I tried that and it had the same behaviour as the current state of this PR.
Signed-off-by: Stephen Sherratt <[email protected]>
c0041b6 to
4090927
Compare
Fixes #12311